public class RecordsFilteringController
{

	public String objectName {get; set;}
	private Map<String, String> fieldsNameAndType;
	
	public List<SelectOption> getFieldsName()
	{
		fieldsNameAndType = new Map<string, String>();
		List<SelectOption> options = new List<SelectOption>();
		options.add(new SelectOption('', '--None--'));
		Map<String,Schema.SObjectType> gd = Schema.getGlobalDescribe();
		Schema.DescribeSObjectResult dsor;
        if(gd.containsKey(objectName))
        {
            dsor = gd.get(objectName).getDescribe();
	        Map<String, Schema.SObjectField> objectFields = dsor.fields.getMap();
	        for(String field: objectFields.keySet())
	        {
	            Schema.DescribeFieldResult dr = objectFields.get(field).getDescribe();
	            if(!String.valueOf(dr.getType()).equals('REFERENCE') && !String.valueOf(dr.getType()).equals('ID') && !String.valueOf(dr.getType()).equals('TEXTAREA'))
	            {
	            	system.debug('::::::::'+dr.getType());
	            	options.add(new SelectOption(dr.getName(), dr.getLabel()));
	            	fieldsNameAndType.put(dr.getName(), String.valueOf(dr.getType()));
	            }
	        }
        }
        //options.sort();
        return options;
	}
	
	public List<SelectOption> getOperators()
	{
		List<SelectOption> options = new List<SelectOption>();
		options.add(new SelectOption('', '--None--'));
		options.add(new SelectOption('=', 'equals'));
		options.add(new SelectOption('!=', 'not equals to'));
		options.add(new SelectOption('like', 'contains'));
		options.add(new SelectOption('does not contains', 'does not contains'));
		options.add(new SelectOption('starts with', 'starts with'));
		return options;
	}

}